<template>
	<view class="">
		<rllr></rllr>
		<view class="bg-white padding-xs">

			<view class="bg-white radius overflow-hidden">
				<view class="bg-white padding-sm flex justify-between align-baseline">
					<text class="text-bold text-black">余额【<text
							class="text-lg text-red">￥{{adz.amount / 100}}</text>】</text>
					<text class="text-gray">提取<text class="cuIcon-right"></text></text>
				</view>
			</view>

			<view class="bg-white radius overflow-hidden margin-top">
				<view class="bg-g-main padding-sm flex justify-between align-baseline">
					<text class="text-main">预约记录</text>
					<text class="text-orange" @tap="toYy">更多<text class="cuIcon-right"></text></text>
				</view>
				<view class="padding-xs bg-g-main">
					<view class="margin-bottom-xs shadow radius bg-white overflow-hidden"
						v-for="(item,index) in yyitems" :key="index">
						<view class="">
							<view
								:class="item.statu == 'C' ? 'bg-red' : (item.statu == 'R' ? 'bg-blue' : (item.statu == 'U' ? 'bg-yellow' : 'bg-gray'))"
								class="padding-sm flex justify-between align-center">
								<text>{{item.yyjlitemid}}</text>
								<text @tap="toYYjlitemInfo(item.yyjlitemid)" class="">详细<text
										class="cuIcon-right"></text></text>
							</view>
							<view class="padding-sm flex justify-between align-center">
								<text>{{item.rq}}</text>
								<text>{{item.st}} - {{item.et}}</text>
							</view>
							<view class="padding-sm flex justify-between align-center">
								<text
									:class="item.statu == 'C' ? 'text-red' : (item.statu == 'R' ? 'text-blue' : (item.statu == 'U' ? 'text-yellow' : 'text-gray'))">{{yystu[item.statu]}}</text>
								<text>
									<text class="text-red">实付金额：￥{{item.sfje}}</text>
									<text class="margin-lr-sm">/</text>
									<text class="text-gray">金额：￥{{item.je}}</text>
								</text>
							</view>
							<view class="padding-sm text-left">{{item.mdmc}}</view>
							<view :class="item.statu == 'R' ? 'justify-between' : ''"
								class="padding-sm flex align-center">
								<text>{{item.fjmc}}</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		data: function() {
			return {
				adz: this.store.state.dz,
				StatusBar: this.StatusBar,
				CustomBar: this.CustomBar,
				yystu: {},
				yyitems: [],
				yynumber: 0,
			}
		},
		created: function() {
			this.constant.get("YYSTU").then(data => {
				this.yystu = data.YYSTU;
			});
			this.init();
		},
		onPullDownRefresh: function() {
			this.init();
			uni.stopPullDownRefresh();
		},
		methods: {
			init: function() {
				this.loadDz();
			},

			toYy: function() {
				uni.navigateTo({
					url: "/pages/cdz/yy/search"
				});
			},

			loadDz: function() {
				this.api("/dz/info/get").send({
					dzid: this.adz.dzid
				}).then(data => {
					this.adz = data.adz;
					this.yynumber = data.yyitems.total;
					this.yyitems = data.yyitems.records;
				});
			},
			toYYjlitemInfo: function(id) {
				uni.navigateTo({
					url: `/pages/cdz/yy/detail?yyjlitemid=${id}`
				})
			}
		}
	}
</script>

<style>
</style>